package com.shbt.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TUniversity entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "t_university", catalog = "default_schema")
public class TUniversity implements java.io.Serializable {

	// Fields

	private Integer id;
	private String universityCode;
	private String universityName;
	private Set<TCollege> TColleges = new HashSet<TCollege>(0);

	// Constructors

	/** default constructor */
	public TUniversity() {
	}

	/** minimal constructor */
	public TUniversity(Integer id) {
		this.id = id;
	}

	/** full constructor */
	public TUniversity(Integer id, String universityCode,
			String universityName, Set<TCollege> TColleges) {
		this.id = id;
		this.universityCode = universityCode;
		this.universityName = universityName;
		this.TColleges = TColleges;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "university_code", length = 20)
	public String getUniversityCode() {
		return this.universityCode;
	}

	public void setUniversityCode(String universityCode) {
		this.universityCode = universityCode;
	}

	@Column(name = "university_name", length = 20)
	public String getUniversityName() {
		return this.universityName;
	}

	public void setUniversityName(String universityName) {
		this.universityName = universityName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TUniversity")
	public Set<TCollege> getTColleges() {
		return this.TColleges;
	}

	public void setTColleges(Set<TCollege> TColleges) {
		this.TColleges = TColleges;
	}

}